home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
apps
/
191
/
applic
/
iffspc.doc
< prev
next >
Wrap
Text File
|
1987-11-20
|
9KB
|
188 lines
IFFSPC
The Amiga IFF to Atari ST Picture Converter
(C) 1987
Steve Belczyk,
SysOp of the Genesis BBS, (617) 664-0149
CompuServe: [75126,515]
Genie: sbelczyk
Shareware notice:
This is a shareware product. If you find it useful (and if you use it to
convert more than one or two Amiga pics I imagine that means you found it
useful), I urge you to send $15, or whatever you feel it's worth, to the
author at this address:
Steve Belczyk
453 Park Street West,
North Reading, MA 01864
Permission is granted to distribute this program freely, provided that this
documentation file accompanies it, unaltered. Commercial use of this product
is prohibited without permission of the author.
Introduction:
Once upon a time, not too long ago, Atari ST owners, while otherwise perfectly
satisfied with their machines, lamented over the limitation of sixteen colors
at a time. They could not hope to display pictures of photographic quality
that were commonplace in the Amiga world. In despair, they plodded through
bland Degas and Tiny pictures.
But lo! Unto these sad souls was delivered Spectrum 512! This brilliant
program was capable of displaying pictures using the entire palette of 512
colors! Moreover, with the clever use of dithering it became possible to
display 4096 colors, just like on the Amiga. The ST graphics community was
set on its ear.
This program, IFFSPC, can read any Amiga IFF picture and will do its best
to turn it into an SPC picture which can be displayed by any of the Spectrum
slideshow programs (SPSLIDE, SPSLID5, and SPSLID7), as well as being read
into Spectrum itself for further editing. There are no size or resolution
restrictions such as those imposed by Spectrum 512.
Operation:
IFFSPC must be run in low resolution. It also requires a few big buffers,
so, if you're using a 520, get rid of that ramdisk and those greedy desk
accessories. After the tacky title page, you will be presented with the
usual file selector dialog box. The Amiga community is not very picky
about extensions on file names, but hopefully you will have renamed your
Amiga pics with a .IFF extension, since that is the default for input to
IFFSPC. I would hope that everyone will keep the name of the SPC pic as
close to the name of the original Amiga pic as possible, so we don't wind
up with half a dozen SPC pics all made from the same Amiga pic.
After selecting the victim, you will be tersely asked if you would like
dithering. Pictures almost always look better dithered, so YES is most
likely your best bet. It's also the default. More on dithering below.
The screen will clear, the input file will be read, and then row after row
of ghastly colors will be plotted. DON'T PANIC! These colors bear little
resemblance to the ultimate appearance of the picture. Nevertheless, I love
to try and guess what the picture will look like by scrutinizing these pseudo-
colors.
Once the screen has been entirely painted, the disk drive will come on
again. IFFSPC is now trying to write name.SPC (assuming you chose name.IFF
as the input file). ANY EXISTING name.SPC WILL BE CLOBBERED! If all goes
well, a message indicating success will appear. At this point you'll rush
off to try the pic with SPSLIDE or SPECTRUM. I hope it turned out well.
Error messages:
"Can't open input file." This one's pretty straightforward. Either you
specified a file that doesn't exist or it is badly damaged.
"Premature EOF." The IFF file is too short. Most likely cause of this
error is an incomplete file transfer at some point.
"Not an IFF pic." The 12-byte header of the so-called IFF file indicates
that this is not an IFF picture file, or perhaps not an IFF file at all.
I get this if I forget to de-ARC the file.
"Unacceptable resolution." The resolution of the picture is not one of
these: 320x200, 320x400, 640x200, or 640x400. I've never run into this
problem.
"Can't open output file." The Fcreate failed on the output SPC file. Either
the disk is full, damaged, or write-protected.
"Write error (disk full?)" IFFSPC couldn't write the entire SPC file. The
disk is either full or damaged.
Theory of operation (or, Why they don't always turn out great):
Each horizontal scan line of an Amiga picture can contain as many as 640
different colors. Spectrum, on the other hand, permits a maximum of 42
colors per scan line (plus black). So, IFFSPC's main task is to take a line
of as many as 640 colors and somehow "dissolve" it into a line of no more
than 42 colors, while preserving as much of the quality of the original pic
as possible. To make matters worse, Spectrum does not allow any pixel on the
line to have any of the 42 colors. Each pixel has only 14 colors to choose
from. This can make life pretty miserable for IFFSPC.
Generally speaking, the way IFFSPC handles this is to sort the pixels on the
scan line by how popular each desired color is on that particular line. In
this way, popular colors get the most attention. The remaining, less popular
colors are simply assigned the popular color that is the closest fit. It is
unavoidable that what IFFSPC thinks is an unimportant color may turn out to
be a color that we humans think is very important. This seems to happen most
often in pictures with faces; the bridge of the nose occupies very few pixels,
but it is exactly where we tend to focus on a face. IFFSPC thinks these pixels
are unimportant, hence you may wind up with an unsightly blemish on the nose.
In the way of reassurance, however, let me say that, of the thirty or forty
Amiga pics I have converted with this program, only two or three turned out
unsatisfactorily. But you are warned.
More on dithering:
Even the magic of Spectrum could not improve on the fact that the ST is
limited, in hardware, to a total of 512 colors (Colorburst notwithstanding),
three bits for each of the primary colors red, green, and blue. The Amiga
sports FOUR bits for each primary, giving it 4096 colors. This is a
significant difference.
Colorburst solves this problem by flipping rapidly between the two closest
ST colors to obtain the desired Amiga color. Very clever, but it does result
in that unsightly flicker. IFFSPC (and Spectrum) use a technique called
dithering. To render an Amiga color that the ST can't produce, every other
pixel is assigned one of the two closest ST colors. This works much better
than it may sound. I find that the patterns introduced by dithering actually
contribute to the overall quality of the picture.
Here's the rub: Dithering can nearly double the number of colors that
IFFSPC has to deal with on each scan line. That's why you are given the
option to dither or not to dither. If a picture does not turn out too
well dithered, cross your fingers and try it without dithering.
Amiga pic pointers:
Before you go running off to the local Amiga board and snarf up every IFF
file you find, there are a few things you should know about Amiga pics.
First of all, the IFF format is used by Amiga owners to exchange plenty of
things besides picture files. Don't download something just because the
description mentions IFF; you might get an Amiga sound file. Instead, look
for keywords like HAM or ILBM along with the IFF. Also, there is an Amiga
feature called color-cycling which IFFSPC does not support. Avoid pictures
that mention color-cycling, or just plain cycling.
As I mentioned before, Amiga owners are not very strict about naming their
files. I've seen picture files with extensions IFF, HAM, PIC, and more.
In fact, most of the picture files had no extension whatsoever. After I
de-arc an Amiga file (fortunately, they use the same ARC program!) I always
rename it to something.IFF.
While it's true that the Amiga has better resolution and more colors than
the ST, that does not mean they're aren't just as many lousy hand-done pics
for the Amiga. Personally, I much prefer digitized photographs. The big
paint program for the Amiga is called Digi-paint, and the big digitizer is
called Digi-view. I grab everything that mentions Digi-view, and avoid
everything that mentions Digi-paint. There is also a slick ray-tracing
program for the Amiga called Sculpt-3D. I liked some of those. But the
digitized HAM pics are the best.
Source code:
If you would like to try to wade through the source code for IFFSPC (about
800 lines of developer's C), you may obtain a printout by simply sending me
a SASE and $10.
Good luck with the program!
Steve B